import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/order_detail_entity.dart';

OrderDetailEntity $OrderDetailEntityFromJson(Map<String, dynamic> json) {
	final OrderDetailEntity orderDetailEntity = OrderDetailEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		orderDetailEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		orderDetailEntity.msg = msg;
	}
	final OrderDetailData? data = jsonConvert.convert<OrderDetailData>(json['data']);
	if (data != null) {
		orderDetailEntity.data = data;
	}
	return orderDetailEntity;
}

Map<String, dynamic> $OrderDetailEntityToJson(OrderDetailEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] = entity.data.toJson();
	return data;
}

OrderDetailData $OrderDetailDataFromJson(Map<String, dynamic> json) {
	final OrderDetailData orderDetailData = OrderDetailData();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		orderDetailData.id = id;
	}
	final String? orderNo = jsonConvert.convert<String>(json['order_no']);
	if (orderNo != null) {
		orderDetailData.orderNo = orderNo;
	}
	final String? userId = jsonConvert.convert<String>(json['user_id']);
	if (userId != null) {
		orderDetailData.userId = userId;
	}
	final OrderDetailDataAddressSnap? addressSnap = jsonConvert.convert<OrderDetailDataAddressSnap>(json['address_snap']);
	if (addressSnap != null) {
		orderDetailData.addressSnap = addressSnap;
	}
	final String? status = jsonConvert.convert<String>(json['status']);
	if (status != null) {
		orderDetailData.status = status;
	}
	final String? remark = jsonConvert.convert<String>(json['remark']);
	if (remark != null) {
		orderDetailData.remark = remark;
	}
	final String? storeId = jsonConvert.convert<String>(json['store_id']);
	if (storeId != null) {
		orderDetailData.storeId = storeId;
	}
	final String? freightPrice = jsonConvert.convert<String>(json['freight_price']);
	if (freightPrice != null) {
		orderDetailData.freightPrice = freightPrice;
	}
	final String? createdAt = jsonConvert.convert<String>(json['created_at']);
	if (createdAt != null) {
		orderDetailData.createdAt = createdAt;
	}
	final String? integral = jsonConvert.convert<String>(json['integral']);
	if (integral != null) {
		orderDetailData.integral = integral;
	}
	final String? payTime = jsonConvert.convert<String>(json['pay_time']);
	if (payTime != null) {
		orderDetailData.payTime = payTime;
	}
	final String? allCompany = jsonConvert.convert<String>(json['all_company']);
	if (allCompany != null) {
		orderDetailData.allCompany = allCompany;
	}
	final String? allCompany1 = jsonConvert.convert<String>(json['all_company1']);
	if (allCompany1 != null) {
		orderDetailData.allCompany1 = allCompany1;
	}
	final String? allMoney = jsonConvert.convert<String>(json['all_money']);
	if (allMoney != null) {
		orderDetailData.allMoney = allMoney;
	}
	final String? allMoney1 = jsonConvert.convert<String>(json['all_money1']);
	if (allMoney1 != null) {
		orderDetailData.allMoney1 = allMoney1;
	}
	final String? goodsCompany = jsonConvert.convert<String>(json['goods_company']);
	if (goodsCompany != null) {
		orderDetailData.goodsCompany = goodsCompany;
	}
	final String? goodsCompany1 = jsonConvert.convert<String>(json['goods_company1']);
	if (goodsCompany1 != null) {
		orderDetailData.goodsCompany1 = goodsCompany1;
	}
	final String? goodsMoney = jsonConvert.convert<String>(json['goods_money']);
	if (goodsMoney != null) {
		orderDetailData.goodsMoney = goodsMoney;
	}
	final String? goodsMoney1 = jsonConvert.convert<String>(json['goods_money1']);
	if (goodsMoney1 != null) {
		orderDetailData.goodsMoney1 = goodsMoney1;
	}
	final String? company = jsonConvert.convert<String>(json['company']);
	if (company != null) {
		orderDetailData.company = company;
	}
	final String? company1 = jsonConvert.convert<String>(json['company1']);
	if (company1 != null) {
		orderDetailData.company1 = company1;
	}
	final String? money = jsonConvert.convert<String>(json['money']);
	if (money != null) {
		orderDetailData.money = money;
	}
	final String? money1 = jsonConvert.convert<String>(json['money1']);
	if (money1 != null) {
		orderDetailData.money1 = money1;
	}
	final String? cancelMinute = jsonConvert.convert<String>(json['cancel_minute']);
	if (cancelMinute != null) {
		orderDetailData.cancelMinute = cancelMinute;
	}
	final List<OrderDetailDataGoods>? goods = jsonConvert.convertListNotNull<OrderDetailDataGoods>(json['goods']);
	if (goods != null) {
		orderDetailData.goods = goods;
	}
	final String? statusStr = jsonConvert.convert<String>(json['status_str']);
	if (statusStr != null) {
		orderDetailData.statusStr = statusStr;
	}
	final String? allPrice = jsonConvert.convert<String>(json['all_price']);
	if (allPrice != null) {
		orderDetailData.allPrice = allPrice;
	}
	final OrderDetailDataStore? store = jsonConvert.convert<OrderDetailDataStore>(json['store']);
	if (store != null) {
		orderDetailData.store = store;
	}
	final String? deliveryTime = jsonConvert.convert<String>(json['delivery_time']);
	if (deliveryTime != null) {
		orderDetailData.deliveryTime = deliveryTime;
	}
	final String? confirmTime = jsonConvert.convert<String>(json['confirm_time']);
	if (confirmTime != null) {
		orderDetailData.confirmTime = confirmTime;
	}
	final String? tag = jsonConvert.convert<String>(json['tag']);
	if (tag != null) {
		orderDetailData.tag = tag;
	}
	final String? storeExpressMoney = jsonConvert.convert<String>(json['store_express_money']);
	if (storeExpressMoney != null) {
		orderDetailData.storeExpressMoney = storeExpressMoney;
	}
	final String? isShowNoticeSend = jsonConvert.convert<String>(json['is_show_notice_send']);
	if (isShowNoticeSend != null) {
		orderDetailData.isShowNoticeSend = isShowNoticeSend;
	}
	return orderDetailData;
}

Map<String, dynamic> $OrderDetailDataToJson(OrderDetailData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['order_no'] = entity.orderNo;
	data['user_id'] = entity.userId;
	data['address_snap'] = entity.addressSnap.toJson();
	data['status'] = entity.status;
	data['remark'] = entity.remark;
	data['store_id'] = entity.storeId;
	data['freight_price'] = entity.freightPrice;
	data['created_at'] = entity.createdAt;
	data['integral'] = entity.integral;
	data['pay_time'] = entity.payTime;
	data['all_company'] = entity.allCompany;
	data['all_company1'] = entity.allCompany1;
	data['all_money'] = entity.allMoney;
	data['all_money1'] = entity.allMoney1;
	data['goods_company'] = entity.goodsCompany;
	data['goods_company1'] = entity.goodsCompany1;
	data['goods_money'] = entity.goodsMoney;
	data['goods_money1'] = entity.goodsMoney1;
	data['company'] = entity.company;
	data['company1'] = entity.company1;
	data['money'] = entity.money;
	data['money1'] = entity.money1;
	data['cancel_minute'] = entity.cancelMinute;
	data['goods'] =  entity.goods.map((v) => v.toJson()).toList();
	data['status_str'] = entity.statusStr;
	data['all_price'] = entity.allPrice;
	data['store'] = entity.store.toJson();
	data['delivery_time'] = entity.deliveryTime;
	data['confirm_time'] = entity.confirmTime;
	data['tag'] = entity.tag;
	data['store_express_money'] = entity.storeExpressMoney;
	data['is_show_notice_send'] = entity.isShowNoticeSend;
	return data;
}

OrderDetailDataAddressSnap $OrderDetailDataAddressSnapFromJson(Map<String, dynamic> json) {
	final OrderDetailDataAddressSnap orderDetailDataAddressSnap = OrderDetailDataAddressSnap();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		orderDetailDataAddressSnap.id = id;
	}
	final String? address = jsonConvert.convert<String>(json['address']);
	if (address != null) {
		orderDetailDataAddressSnap.address = address;
	}
	final String? username = jsonConvert.convert<String>(json['username']);
	if (username != null) {
		orderDetailDataAddressSnap.username = username;
	}
	final String? mobile = jsonConvert.convert<String>(json['mobile']);
	if (mobile != null) {
		orderDetailDataAddressSnap.mobile = mobile;
	}
	return orderDetailDataAddressSnap;
}

Map<String, dynamic> $OrderDetailDataAddressSnapToJson(OrderDetailDataAddressSnap entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['address'] = entity.address;
	data['username'] = entity.username;
	data['mobile'] = entity.mobile;
	return data;
}

OrderDetailDataGoods $OrderDetailDataGoodsFromJson(Map<String, dynamic> json) {
	final OrderDetailDataGoods orderDetailDataGoods = OrderDetailDataGoods();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		orderDetailDataGoods.id = id;
	}
	final String? orderNo = jsonConvert.convert<String>(json['order_no']);
	if (orderNo != null) {
		orderDetailDataGoods.orderNo = orderNo;
	}
	final String? skuId = jsonConvert.convert<String>(json['sku_id']);
	if (skuId != null) {
		orderDetailDataGoods.skuId = skuId;
	}
	final String? goodsId = jsonConvert.convert<String>(json['goods_id']);
	if (goodsId != null) {
		orderDetailDataGoods.goodsId = goodsId;
	}
	final OrderDetailDataGoodsSkuSnap? skuSnap = jsonConvert.convert<OrderDetailDataGoodsSkuSnap>(json['sku_snap']);
	if (skuSnap != null) {
		orderDetailDataGoods.skuSnap = skuSnap;
	}
	final String? buyNum = jsonConvert.convert<String>(json['buy_num']);
	if (buyNum != null) {
		orderDetailDataGoods.buyNum = buyNum;
	}
	final String? allPrice = jsonConvert.convert<String>(json['all_price']);
	if (allPrice != null) {
		orderDetailDataGoods.allPrice = allPrice;
	}
	final String? unitPrice = jsonConvert.convert<String>(json['unit_price']);
	if (unitPrice != null) {
		orderDetailDataGoods.unitPrice = unitPrice;
	}
	final String? storeId = jsonConvert.convert<String>(json['store_id']);
	if (storeId != null) {
		orderDetailDataGoods.storeId = storeId;
	}
	final String? createdAt = jsonConvert.convert<String>(json['created_at']);
	if (createdAt != null) {
		orderDetailDataGoods.createdAt = createdAt;
	}
	final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
	if (updatedAt != null) {
		orderDetailDataGoods.updatedAt = updatedAt;
	}
	final String? areaType = jsonConvert.convert<String>(json['area_type']);
	if (areaType != null) {
		orderDetailDataGoods.areaType = areaType;
	}
	final String? unitIntegral = jsonConvert.convert<String>(json['unit_integral']);
	if (unitIntegral != null) {
		orderDetailDataGoods.unitIntegral = unitIntegral;
	}
	final String? allIntegral = jsonConvert.convert<String>(json['all_integral']);
	if (allIntegral != null) {
		orderDetailDataGoods.allIntegral = allIntegral;
	}
	final String? userId = jsonConvert.convert<String>(json['user_id']);
	if (userId != null) {
		orderDetailDataGoods.userId = userId;
	}
	final List<OrderDetailDataGoodsSpec>? spec = jsonConvert.convertListNotNull<OrderDetailDataGoodsSpec>(json['spec']);
	if (spec != null) {
		orderDetailDataGoods.spec = spec;
	}
	final String? company = jsonConvert.convert<String>(json['company']);
	if (company != null) {
		orderDetailDataGoods.company = company;
	}
	final String? company1 = jsonConvert.convert<String>(json['company1']);
	if (company1 != null) {
		orderDetailDataGoods.company1 = company1;
	}
	final String? money = jsonConvert.convert<String>(json['money']);
	if (money != null) {
		orderDetailDataGoods.money = money;
	}
	final String? money1 = jsonConvert.convert<String>(json['money1']);
	if (money1 != null) {
		orderDetailDataGoods.money1 = money1;
	}
	final String? statusDetail = jsonConvert.convert<String>(json['status_detail']);
	if (statusDetail != null) {
		orderDetailDataGoods.statusDetail = statusDetail;
	}
	return orderDetailDataGoods;
}

Map<String, dynamic> $OrderDetailDataGoodsToJson(OrderDetailDataGoods entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['order_no'] = entity.orderNo;
	data['sku_id'] = entity.skuId;
	data['goods_id'] = entity.goodsId;
	data['sku_snap'] = entity.skuSnap.toJson();
	data['buy_num'] = entity.buyNum;
	data['all_price'] = entity.allPrice;
	data['unit_price'] = entity.unitPrice;
	data['store_id'] = entity.storeId;
	data['created_at'] = entity.createdAt;
	data['updated_at'] = entity.updatedAt;
	data['area_type'] = entity.areaType;
	data['unit_integral'] = entity.unitIntegral;
	data['all_integral'] = entity.allIntegral;
	data['user_id'] = entity.userId;
	data['spec'] =  entity.spec.map((v) => v.toJson()).toList();
	data['company'] = entity.company;
	data['company1'] = entity.company1;
	data['money'] = entity.money;
	data['money1'] = entity.money1;
	data['status_detail'] = entity.statusDetail;
	return data;
}

OrderDetailDataGoodsSkuSnap $OrderDetailDataGoodsSkuSnapFromJson(Map<String, dynamic> json) {
	final OrderDetailDataGoodsSkuSnap orderDetailDataGoodsSkuSnap = OrderDetailDataGoodsSkuSnap();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		orderDetailDataGoodsSkuSnap.id = id;
	}
	final String? goodsId = jsonConvert.convert<String>(json['goods_id']);
	if (goodsId != null) {
		orderDetailDataGoodsSkuSnap.goodsId = goodsId;
	}
	final List<String>? specKey = jsonConvert.convertListNotNull<String>(json['spec_key']);
	if (specKey != null) {
		orderDetailDataGoodsSkuSnap.specKey = specKey;
	}
	final List<String>? specVal = jsonConvert.convertListNotNull<String>(json['spec_val']);
	if (specVal != null) {
		orderDetailDataGoodsSkuSnap.specVal = specVal;
	}
	final String? imgPath = jsonConvert.convert<String>(json['img_path']);
	if (imgPath != null) {
		orderDetailDataGoodsSkuSnap.imgPath = imgPath;
	}
	final String? price = jsonConvert.convert<String>(json['price']);
	if (price != null) {
		orderDetailDataGoodsSkuSnap.price = price;
	}
	final String? integral = jsonConvert.convert<String>(json['integral']);
	if (integral != null) {
		orderDetailDataGoodsSkuSnap.integral = integral;
	}
	final String? stock = jsonConvert.convert<String>(json['stock']);
	if (stock != null) {
		orderDetailDataGoodsSkuSnap.stock = stock;
	}
	final OrderDetailDataGoodsSkuSnapGoods? goods = jsonConvert.convert<OrderDetailDataGoodsSkuSnapGoods>(json['goods']);
	if (goods != null) {
		orderDetailDataGoodsSkuSnap.goods = goods;
	}
	return orderDetailDataGoodsSkuSnap;
}

Map<String, dynamic> $OrderDetailDataGoodsSkuSnapToJson(OrderDetailDataGoodsSkuSnap entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['goods_id'] = entity.goodsId;
	data['spec_key'] =  entity.specKey;
	data['spec_val'] =  entity.specVal;
	data['img_path'] = entity.imgPath;
	data['price'] = entity.price;
	data['integral'] = entity.integral;
	data['stock'] = entity.stock;
	data['goods'] = entity.goods.toJson();
	return data;
}

OrderDetailDataGoodsSkuSnapGoods $OrderDetailDataGoodsSkuSnapGoodsFromJson(Map<String, dynamic> json) {
	final OrderDetailDataGoodsSkuSnapGoods orderDetailDataGoodsSkuSnapGoods = OrderDetailDataGoodsSkuSnapGoods();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		orderDetailDataGoodsSkuSnapGoods.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		orderDetailDataGoodsSkuSnapGoods.name = name;
	}
	final String? storeId = jsonConvert.convert<String>(json['store_id']);
	if (storeId != null) {
		orderDetailDataGoodsSkuSnapGoods.storeId = storeId;
	}
	final String? areaId = jsonConvert.convert<String>(json['area_id']);
	if (areaId != null) {
		orderDetailDataGoodsSkuSnapGoods.areaId = areaId;
	}
	return orderDetailDataGoodsSkuSnapGoods;
}

Map<String, dynamic> $OrderDetailDataGoodsSkuSnapGoodsToJson(OrderDetailDataGoodsSkuSnapGoods entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['store_id'] = entity.storeId;
	data['area_id'] = entity.areaId;
	return data;
}

OrderDetailDataGoodsSpec $OrderDetailDataGoodsSpecFromJson(Map<String, dynamic> json) {
	final OrderDetailDataGoodsSpec orderDetailDataGoodsSpec = OrderDetailDataGoodsSpec();
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		orderDetailDataGoodsSpec.name = name;
	}
	final String? val = jsonConvert.convert<String>(json['val']);
	if (val != null) {
		orderDetailDataGoodsSpec.val = val;
	}
	return orderDetailDataGoodsSpec;
}

Map<String, dynamic> $OrderDetailDataGoodsSpecToJson(OrderDetailDataGoodsSpec entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['name'] = entity.name;
	data['val'] = entity.val;
	return data;
}

OrderDetailDataStore $OrderDetailDataStoreFromJson(Map<String, dynamic> json) {
	final OrderDetailDataStore orderDetailDataStore = OrderDetailDataStore();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		orderDetailDataStore.id = id;
	}
	final String? logo = jsonConvert.convert<String>(json['logo']);
	if (logo != null) {
		orderDetailDataStore.logo = logo;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		orderDetailDataStore.name = name;
	}
	final String? contact = jsonConvert.convert<String>(json['contact']);
	if (contact != null) {
		orderDetailDataStore.contact = contact;
	}
	return orderDetailDataStore;
}

Map<String, dynamic> $OrderDetailDataStoreToJson(OrderDetailDataStore entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['logo'] = entity.logo;
	data['name'] = entity.name;
	data['contact'] = entity.contact;
	return data;
}